/*
 * File: Series.java
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package tvseries.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

/**
 * DAO object for a series.
 * 
 * @author nish.naidoo@gmail.com
 *
 */

public class Series implements Serializable, Comparable<Series>
{
	private static final long serialVersionUID = -5768718154004969817L;

	private String id = null;
	private String title = null;
	private String imdbUrl = null;
	private String summary = null;
	private Date lastUpdate = null;

	private Set<Episode> episodes = null;

	/**
	 * @return the id
	 */
	public String getId()
	{
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(String id)
	{
		this.id = id;
	}

	/**
	 * @return the title
	 */
	public String getTitle()
	{
		return title;
	}

	/**
	 * @param title the title to set
	 */
	public void setTitle(String title)
	{
		this.title = title;
	}

	/**
	 * @return the imdbUrl
	 */
	public String getImdbUrl()
	{
		return imdbUrl;
	}

	/**
	 * @param imdbUrl the imdbUrl to set
	 */
	public void setImdbUrl(String imdbUrl)
	{
		this.imdbUrl = imdbUrl;
	}

	/**
	 * @return the summary
	 */
	public String getSummary()
	{
		return summary;
	}

	/**
	 * @param summary the summary to set
	 */
	public void setSummary(String summary)
	{
		this.summary = summary;
	}

	/**
	 * @return the lastUpdate
	 */
	public Date getLastUpdate()
	{
		return lastUpdate;
	}

	/**
	 * @param lastUpdate the lastUpdate to set
	 */
	public void setLastUpdate(Date lastUpdate)
	{
		this.lastUpdate = lastUpdate;
	}

	/**
	 * @return the episodes
	 */
	public Set<Episode> getEpisodes()
	{
		return episodes;
	}

	/**
	 * @param episodes the episodes to set
	 */
	public void setEpisodes(Set<Episode> episodes)
	{
		this.episodes = episodes;
	}

	public int compareTo(Series s)
	{
		return this.title.compareToIgnoreCase(s.getTitle());
	}
}
